package com.ajavaer.framework.config;

import com.ajavaer.framework.common.tools.StringTools;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 微信支付
 */
@ConfigurationProperties(prefix = "ajavaer.pay.alipay")
public class AlipayConfig {
    private String appid;
    private String privateKey;
    private String alipayPublicKey;
    private String notifyUrl;
    private String charset = StringTools.UTF8.name();
    private String signType = "RSA2";
    private String aesKey;
    private String gatewayUrl = "https://openapi.alipay.com/gateway.do";

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getPrivateKey() {
        return privateKey;
    }

    public void setPrivateKey(String privateKey) {
        this.privateKey = privateKey;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getGatewayUrl() {
        return gatewayUrl;
    }

    public void setGatewayUrl(String gatewayUrl) {
        this.gatewayUrl = gatewayUrl;
    }

    public String getCharset() {
        return charset;
    }

    public void setCharset(String charset) {
        this.charset = charset;
    }

    public String getSignType() {
        return signType;
    }

    public void setSignType(String signType) {
        this.signType = signType;
    }

    public String getAesKey() {
        return aesKey;
    }

    public void setAesKey(String aesKey) {
        this.aesKey = aesKey;
    }

    public String getAlipayPublicKey() {
        return alipayPublicKey;
    }

    public void setAlipayPublicKey(String alipayPublicKey) {
        this.alipayPublicKey = alipayPublicKey;
    }

    public boolean needEncrypt() {
        return StringTools.isNotBlank(this.aesKey);
    }
}
